<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>登陆</title>

    <link href="css/style.css" rel="stylesheet" th:href="@{/css/style.css}">
    <!-- 响应式样式 -->
    <link href="css/style-responsive.css" rel="stylesheet"  th:href="@{/css/style-responsive.css}">

    <!-- js IE8支持HTML5元素和媒体查询 IE 兼容脚本 -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js" th:src="@{/js/html5shiv.js}"></script>
    <script src="js/respond.min.js" th:src="@{/js/respond.min.js}"></script>
    <![endif]-->
</head>

<body class="login-body">

<div class="container">

    <form class="form-signin" action="/index/teaLogin" method="post" name="login" onsubmit="return check()">
        <div class="form-signin-heading text-center">
            <h1 class="sign-title">老师你好，请登录</h1>
            <img src="images/login-logo.png" alt=""/>
        </div>
        <div class="login-wrap">
            <input type="text" class="form-control" placeholder="用户名" autofocus name="teaId">
            <span style="color: red" th:if="${not #strings.isEmpty(em_id)}" th:text="${em_id}"></span>
            <input type="password" class="form-control" placeholder="密码" name="teaPassword">
            <span style="color: red" th:if="${not #strings.isEmpty(em_pwd)}" th:text="${em_pwd}"></span>

            <button class="btn btn-lg btn-login btn-block" type="submit">
                <i class="fa fa-check"></i>
            </button>

            <label class="checkbox">
                <input type="checkbox" value="remember-me"> 记住密码
                <span class="pull-right">
                    <a data-toggle="modal" href="#myModal"> 忘记密码?</a>
                </span>
            </label>

        </div>

        <!-- Modal -->
        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">忘记了密码 ?</h4>
                    </div>
                    <div class="modal-body">
                        <p>输入您的电子邮件地址重新设置您的密码.</p>
                        <input type="text" name="email" placeholder="邮箱" autocomplete="off" class="form-control placeholder-no-fix">

                    </div>
                    <div class="modal-footer">
                        <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
                        <button class="btn btn-primary" type="button">提交</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- modal -->

    </form>

</div>



<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="js/jquery-1.10.2.min.js" th:src="@{/js/jquery-1.10.2.min.js}"></script>
<script src="js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
<script src="js/modernizr.min.js" th:src="@{/js/modernizr.min.js}"></script>
<script>
    function check(){
        var form = document.forms["login"];
        var teaId = form["teaId"].value;
        var teaPassword = form["teaPassword"].value;
        if(teaId == null || teaId == ""){
            alert("账号不能为空");
            return false;
        }
        if(teaPassword == null || teaPassword == ""){
            alert("密码不能为空");
            return false;
        }
    }
</script>
</body>
</html>
